package com.ajk.shop.service;

import java.util.List;

import com.ajk.shop.model.ImputedPrice;
import com.ajk.shop.model.OrderInfo;
import com.ajk.shop.model.request.OrderInfoReq;
import com.ajk.shop.model.response.OrderDetailsRes;
import com.ajk.shop.model.response.OrderInfoRes;
import com.ajk.shop.model.response.UserDefaultAddressInvoice;


/** 
 * @author 作者 : chenxuan
 * @version 创建时间：2016年1月6日 上午9:38:29 
 * 类说明 
 */
public interface OrderService {
	
	/**
	 * 创建订单
	 * @param orderInfo
	 * @return
	 */
	public OrderInfoRes createOrder(OrderInfoReq orderInfoReq);
	/**
	 * 取消订单
	 * @param orderInfoReq
	 */
	public void cancelOrder(OrderInfoReq orderInfoReq);
	/**
	 * 确认收货
	 * @param orderInfoReq
	 */
	public void confirmReceipt(OrderInfoReq orderInfoReq);
	/**
	 * 支付成功callback
	 * @param orderNo
	 * @param payChannel
	 * @param buyerAccount
	 */
	public void paySuccessCallback(String orderNo,String payChannel,String buyerAccount,String chId);
	
	/**
	 * 计算邮费
	 * @param userAddress
	 * @return
	 */
	public ImputedPrice calculatePostage(OrderInfoReq orderInfoReq);
	/**
	 * 调用支付成功的webhook
	 * @param orderNo
	 */
	public void callWebhookPayrSuccess(String orderNo);
	/**
	 * 创建订单
	 * @param orderInfoReq
	 * @return
	 */
	public OrderInfoRes generageOrder(OrderInfoReq orderInfoReq);
	/**
	 * 用户订单列表
	 * @return
	 */
	public List<OrderInfoRes> userOrderList(OrderInfoReq orderInfoReq);
	/**
	 * 订单详情
	 * @param orderId
	 * @return
	 */
	public OrderInfoRes orderDetail(OrderInfoReq orderInfoReq);
	/**
	 * 根据orderId获取订单
	 * @param orderId
	 * @return
	 */
	public OrderInfo getOrderInfoById(Integer orderId);
	/**
	 * 校验订单能否支付
	 * @param orderId
	 * @return
	 */
	public OrderInfo checkOrderCouldPay(Integer orderId);
	/**
	 * 获取订单详情
	 * @param orderInfoReq
	 * @return
	 */
	public OrderInfoRes getOrderInfoByOrderNo(OrderInfoReq orderInfoReq);
	
	/**
	 * 根据订单号获取订单详情
	 * @param orderNo
	 * @return
	 */
	public OrderInfoRes getOrderInfoByOrderNo(String orderNo);
	
	/**
	 * 获取用户默认地址和发票信息
	 * @return
	 */
	public UserDefaultAddressInvoice getUserDefaultAddressInvoice(Integer userId);
	/**
	 * 根据订单ID获取订单详情列表
	 * @param orderId
	 * @return
	 */
	public List<OrderDetailsRes> getOrderDetailsList(Integer orderId);
	
	/**
	 * 支付回调
	 * @param orderNo
	 * @param channel
	 * @param buyerAccount
	 * @param chId
	 */
	public void webhookPayrSuccessCallBack(String orderNo,String channel,String buyerAccount,String chId);
	
	public List<OrderInfoRes> orderLisr(OrderInfoReq orderInfoReq);
	
	public Integer orderLisrCount(OrderInfoReq orderInfoReq);
	
	
	public Integer shippingOrder(OrderInfoReq orderInfoReq);
	
}
